From b28042129a8cfba7495af36b47021a2c905ea728 Mon Sep 17 00:00:00 2001 From: robertl Date: Fri, 7 Apr 2006 18:10:34 +0000 Subject: [PATCH] Add gbsleep for Ron. --- gpsbabel/Makefile.in | 2 +- gpsbabel/config.h.in | 10 ++--- gpsbabel/configure | 102 ++++++++++++++++++++++++++++++++++++++++++ gpsbabel/configure.in | 1 + gpsbabel/defs.h | 5 +++ 5 files changed, 114 insertions(+), 6 deletions(-) diff --git a/gpsbabel/Makefile.in b/gpsbabel/Makefile.in index 65e82d872..edb6c1a01 100644 --- a/gpsbabel/Makefile.in +++ b/gpsbabel/Makefile.in @@ -69,7 +69,7 @@ SHAPE=shapelib/shpopen.o shapelib/dbfopen.o LIBOBJS = queue.o route.o waypt.o filter_vecs.o util.o vecs.o mkshort.o \ csv_util.o strptime.o grtcirc.o vmem.o util_crc.o xmlgeneric.o \ uuid.o formspec.o xmltag.o cet.o cet_util.o fatal.o rgbcolors.o \ - inifile.o garmin_fs.o \ + inifile.o garmin_fs.o gbsleep.o \ $(COLDSYNC) $(GARMIN) $(JEEPS) $(SHAPE) $(FMTS) $(FILTERS) OBJS = main.o globals.o $(LIBOBJS) diff --git a/gpsbabel/config.h.in b/gpsbabel/config.h.in index c87d6e19b..405ec108a 100644 --- a/gpsbabel/config.h.in +++ b/gpsbabel/config.h.in @@ -1,14 +1,17 @@ /* config.h.in. Generated from configure.in by autoheader. */ -/* Define to 1 if you have the `expat' library (-lexpat). */ +/* Defined if you have libexpat */ #undef HAVE_LIBEXPAT /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM -/* Define to 1 if you have the `usb' library (-lusb). */ +/* Defined if you have libusb */ #undef HAVE_LIBUSB +/* Define to 1 if you have the `nanosleep' function. */ +#undef HAVE_NANOSLEEP + /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT @@ -23,6 +26,3 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS diff --git a/gpsbabel/configure b/gpsbabel/configure index aa5721b22..6b27bd447 100755 --- a/gpsbabel/configure +++ b/gpsbabel/configure @@ -2675,6 +2675,108 @@ fi # AC_FUNC_VPRINTF # AC_CHECK_FUNCS([atexit floor localtime_r memmove memset pow select sqrt strchr strcspn strdup strerror strncasecmp strrchr strspn strstr strtol strtoul]) +for ac_func in nanosleep +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + #AC_CONFIG_FILES([Makefile # coldsync/Makefile # doc/Makefile diff --git a/gpsbabel/configure.in b/gpsbabel/configure.in index 629853f03..6003a9c7f 100644 --- a/gpsbabel/configure.in +++ b/gpsbabel/configure.in @@ -100,6 +100,7 @@ AC_SUBST(EXPAT_LIB) # AC_FUNC_STRTOD # AC_FUNC_VPRINTF # AC_CHECK_FUNCS([atexit floor localtime_r memmove memset pow select sqrt strchr strcspn strdup strerror strncasecmp strrchr strspn strstr strtol strtoul]) +AC_CHECK_FUNCS(nanosleep) #AC_CONFIG_FILES([Makefile # coldsync/Makefile diff --git a/gpsbabel/defs.h b/gpsbabel/defs.h index c639d0c3f..3976c2db7 100644 --- a/gpsbabel/defs.h +++ b/gpsbabel/defs.h @@ -711,6 +711,11 @@ double degrees2ddmm(double deg_val); unsigned long get_crc32(const void * data, int datalen); unsigned long get_crc32_s(const void * data); +/* + * From gbsleep.c + */ +void gb_sleep(unsigned long microseconds); + /* * Color helpers. */ -- 2.30.2